package br.com.gesclub.business.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import br.com.gesclub.enums.SimNaoEnum;

@Entity
@Table(name = "TIPO_EVENTO")
public class TipoEvento extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "CD_TIPOEVENTO", unique = true, updatable = false, nullable = false)
	private Long id;
	
	@Column(name = "NM_TIPOEVENTO", unique = true, updatable = false, nullable = false, length = 80)
	private String nome;

	@Column(name = "IN_TIPOEVENTO", nullable = false)
	@Type(type = "br.com.gesclub.business.dao.util.GenericEnumUserType",
			parameters = {
			@Parameter (name = "enumClass", value = "br.com.gesclub.enums.SimNaoEnum"),
			@Parameter (name = "identifierMethod", value = "getCodigo"),
			@Parameter (name = "valueOfMethod", value = "from")
	})
	private SimNaoEnum ativo;

	@Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public SimNaoEnum getAtivo() {
		return ativo;
	}

	public void setAtivo(SimNaoEnum ativo) {
		this.ativo = ativo;
	}

}
